<table class="kunTable">
<thead>
	<th width="10">{{ helper:lang line='global:stt' }}</th>
	<th>{{ helper:lang line='emp_off:title' }}</th>
	<th>{{ helper:lang line='emp_off:datecreate' }}</th>
	<th colspan="2" class="tc width15">{{ helper:lang line='emp_off:time' }}</th>
	<th></th>
</thead>
<tbody>
<?php foreach($model as $item) { ?>
	<tr>
		<td>{{ helper:count identifier }}</td>
		<td><?php echo $item->title ?></td>
		<td>{{ helper:date format = 'd-m-Y H:i' timestamp = '<?php echo $item->daycreated ?>' }}</td>
		<td class="width20">{{ helper:date format = 'd-m-Y H:i' timestamp = '<?php echo $item->time_start ?>' }}</td>
		<td class="width20">{{ helper:date format = 'd-m-Y H:i' timestamp = '<?php echo $item->time_end ?>' }}</td>
		<td>
			<?php if($item->status == 2){?>
			<a class="stop" href="{{url:site uri='emp_off/delete/<?php echo $item->id?>'}}" title="{{helper:lang line='global:delete'}}">{{helper:lang line='global:delete'}}</a>
			<?php } ?>
		</td>
	</tr>
<?php } ?>
</tbody>
</table>
<script type="text/javascript">
var total_page = parseInt('{{total_page}}');

//$('select[name="f_page"]').next("div").html('');
//$('select[name="f_page"]').chosen();
$options = '';
for($i = 0; $i < total_page; $i++){
	$options += '<option value="'+$i+'">{{helper:lang line="global:page"}} '+($i+1)+'</option>';
}
$('select[name="f_page"]').html($options);
//$('select[name="f_page"]').next("div").remove();
//$('select[name="f_page"]').chosen();
if(total_page > 1){
	$('select[name="f_page"]').next("div").show();
	$('select[name="f_page"] option').eq('{{page_index}}').attr('selected', 'selected')
	$('select[name="f_page"]').trigger("liszt:updated");
}
else{
	$('select[name="f_page"]').next("div").hide();
}

$('a.stop').click(function(){
	$mes = confirm("{{helper:lang line='emp_off:delete_question'}}");
	if($mes == true)
		return true;
	else
		return false;
});
</script>
